using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Bxas.Core;
using System.Xml.Serialization;
using DigitalAmele.BLL.Abstracts;
using DigitalAmele.BLL.Adapters;
using DigitalAmele.BLL.Core;

namespace DigitalAmele.BLL.Adapters
{
    [XmlType(Namespace = "urn:DataObjects")]
    [XmlRoot(Namespace = "urn:DataObjects")]
    [Serializable]
    public class MemberRoles : ColumnInfo
    {
        public MemberRoles()
        {
            this.priymatyKeyColumnName = "Id";
            this.priymatyKeyColumnType = typeof(System.Guid);
            this.TableName = "MemberRoles";
        }

        #region Fields
		private Guid id = System.Guid.Empty;
		private Guid memberId = System.Guid.Empty;
		private Int16 roleId = -1;
		private DateTime createDate = new DateTime();
		private DateTime modifiedDate = new DateTime();
		private bool isActive = false;
		private bool isDeleted = false;

        #endregion
        
        #region Properties
 
		///<summary>
		///Required = true
		///DBType = uniqueidentifier
		///C# Type = Guid
		///</summary> 
		[ColumnAttributes("Id",true,"Guid")]
		public Guid Id
		{
			 get 
			 {
			    return id;
			 }
			 set 
			 { 
			    if (value != id)
			    { 
			      id = value; 
			      IsUpdateOrInsert.Add(MemberRoles.ColumnNames.Id, true); 
			      this.IsDirty = true; 
			    }
			 }
		}
 
		///<summary>
		///Required = true
		///DBType = uniqueidentifier
		///C# Type = Guid
		///</summary> 
		[ColumnAttributes("MemberId",true,"Guid")]
		public Guid MemberId
		{
			 get 
			 {
			    return memberId;
			 }
			 set 
			 { 
			    if (value != memberId)
			    { 
			      memberId = value; 
			      IsUpdateOrInsert.Add(MemberRoles.ColumnNames.MemberId, true); 
			      this.IsDirty = true; 
			    }
			 }
		}
 
		///<summary>
		///Required = true
		///DBType = smallint
		///C# Type = Int16
		///</summary> 
		[ColumnAttributes("RoleId",true,"Int16")]
		public Int16 RoleId
		{
			 get 
			 {
			    return roleId;
			 }
			 set 
			 { 
			    if (value != roleId)
			    { 
			      roleId = value; 
			      IsUpdateOrInsert.Add(MemberRoles.ColumnNames.RoleId, true); 
			      this.IsDirty = true; 
			    }
			 }
		}
 
		///<summary>
		///Required = true
		///DBType = datetime
		///C# Type = DateTime
		///</summary> 
		[ColumnAttributes("CreateDate",true,"DateTime")]
		public DateTime CreateDate
		{
			 get 
			 {
			    return createDate;
			 }
			 set 
			 { 
			    if (value != createDate)
			    { 
			      createDate = value; 
			      IsUpdateOrInsert.Add(MemberRoles.ColumnNames.CreateDate, true); 
			      this.IsDirty = true; 
			    }
			 }
		}
 
		///<summary>
		///Required = true
		///DBType = datetime
		///C# Type = DateTime
		///</summary> 
		[ColumnAttributes("ModifiedDate",true,"DateTime")]
		public DateTime ModifiedDate
		{
			 get 
			 {
			    return modifiedDate;
			 }
			 set 
			 { 
			    if (value != modifiedDate)
			    { 
			      modifiedDate = value; 
			      IsUpdateOrInsert.Add(MemberRoles.ColumnNames.ModifiedDate, true); 
			      this.IsDirty = true; 
			    }
			 }
		}
 
		///<summary>
		///Required = true
		///DBType = bit
		///C# Type = bool
		///</summary> 
		[ColumnAttributes("IsActive",true,"bool")]
		public bool IsActive
		{
			 get 
			 {
			    return isActive;
			 }
			 set 
			 { 
			    if (value != isActive)
			    { 
			      isActive = value; 
			      IsUpdateOrInsert.Add(MemberRoles.ColumnNames.IsActive, true); 
			      this.IsDirty = true; 
			    }
			 }
		}
 
		///<summary>
		///Required = true
		///DBType = bit
		///C# Type = bool
		///</summary> 
		[ColumnAttributes("IsDeleted",true,"bool")]
		public bool IsDeleted
		{
			 get 
			 {
			    return isDeleted;
			 }
			 set 
			 { 
			    if (value != isDeleted)
			    { 
			      isDeleted = value; 
			      IsUpdateOrInsert.Add(MemberRoles.ColumnNames.IsDeleted, true); 
			      this.IsDirty = true; 
			    }
			 }
		}

        #endregion
		        
        #region StringProperties
 
		///<summary>
		///Required = true
		///DBType = uniqueidentifier
		///C# Type = Guid
		///</summary> 
		public virtual string s_Id
		{
			 get 
			 {
			        return Getuniqueidentifier_s(id);
			 }
			 set 
			 { 
			        Setuniqueidentifier_s(value, ref id);
			        IsUpdateOrInsert.Add(MemberRoles.ColumnNames.Id, true);
			        this.IsDirty = true;
			 }
		}
 
		///<summary>
		///Required = true
		///DBType = uniqueidentifier
		///C# Type = Guid
		///</summary> 
		public virtual string s_MemberId
		{
			 get 
			 {
			        return Getuniqueidentifier_s(memberId);
			 }
			 set 
			 { 
			        Setuniqueidentifier_s(value, ref memberId);
			        IsUpdateOrInsert.Add(MemberRoles.ColumnNames.MemberId, true);
			        this.IsDirty = true;
			 }
		}
 
		///<summary>
		///Required = true
		///DBType = smallint
		///C# Type = Int16
		///</summary> 
		public virtual string s_RoleId
		{
			 get 
			 {
			        return Getsmallint_s(roleId);
			 }
			 set 
			 { 
			        Setsmallint_s(value, ref roleId);
			        IsUpdateOrInsert.Add(MemberRoles.ColumnNames.RoleId, true);
			        this.IsDirty = true;
			 }
		}
 
		///<summary>
		///Required = true
		///DBType = datetime
		///C# Type = DateTime
		///</summary> 
		public virtual string s_CreateDate
		{
			 get 
			 {
			        return Getdatetime_s(createDate);
			 }
			 set 
			 { 
			        Setdatetime_s(value, ref createDate);
			        IsUpdateOrInsert.Add(MemberRoles.ColumnNames.CreateDate, true);
			        this.IsDirty = true;
			 }
		}
 
		///<summary>
		///Required = true
		///DBType = datetime
		///C# Type = DateTime
		///</summary> 
		public virtual string s_ModifiedDate
		{
			 get 
			 {
			        return Getdatetime_s(modifiedDate);
			 }
			 set 
			 { 
			        Setdatetime_s(value, ref modifiedDate);
			        IsUpdateOrInsert.Add(MemberRoles.ColumnNames.ModifiedDate, true);
			        this.IsDirty = true;
			 }
		}
 
		///<summary>
		///Required = true
		///DBType = bit
		///C# Type = bool
		///</summary> 
		public virtual string s_IsActive
		{
			 get 
			 {
			        return Getbit_s(isActive);
			 }
			 set 
			 { 
			        Setbit_s(value, ref isActive);
			        IsUpdateOrInsert.Add(MemberRoles.ColumnNames.IsActive, true);
			        this.IsDirty = true;
			 }
		}
 
		///<summary>
		///Required = true
		///DBType = bit
		///C# Type = bool
		///</summary> 
		public virtual string s_IsDeleted
		{
			 get 
			 {
			        return Getbit_s(isDeleted);
			 }
			 set 
			 { 
			        Setbit_s(value, ref isDeleted);
			        IsUpdateOrInsert.Add(MemberRoles.ColumnNames.IsDeleted, true);
			        this.IsDirty = true;
			 }
		}

        #endregion

		#region ColumnNames
        public class ColumnNames
        {
		public const string Id = "Id";
		public const string MemberId = "MemberId";
		public const string RoleId = "RoleId";
		public const string CreateDate = "CreateDate";
		public const string ModifiedDate = "ModifiedDate";
		public const string IsActive = "IsActive";
		public const string IsDeleted = "IsDeleted";

        }
        #endregion
    }
}

namespace DigitalAmele.BLL.Abstracts
{
    public class _MemberRolesBs : BaseBs
    {
		public Boolean insert(MemberRoles p) { return this._insert<MemberRoles>(p); }
        public Boolean update(MemberRoles p) { return this._update<MemberRoles>(p); }
        public Boolean delete(MemberRoles p) { return this._delete<MemberRoles>(p); }
        public List<MemberRoles> get(string sql) { return this._get<MemberRoles>(sql); }
        public List<MemberRoles> get(System.Data.SqlClient.SqlCommand sqlcommand) { return this._get<MemberRoles>(sqlcommand); }
		public List<MemberRoles> get_all(List<string> columnNames) { return this._get_all<MemberRoles>(columnNames); }
        public List<MemberRoles> get_all_with_all_columns() { return this._get_all_with_all_columns<MemberRoles>(); }
		public MemberRoles get_by_primarykey(System.Guid pk, List<string> columnNames) { return this._get_by_primarykey<MemberRoles>(pk, columnNames); }
    }
}
